import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'

import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import axios from 'axios'
import shijian from './dayjs.min.js'
import slideVerify from "vue-monoplasty-slide-verify";//验证码


// vue中导出excel表格模板
import FileSaver from 'file-saver'  
// import XLSX from 'xlsx'
import * as XLSX from 'xlsx'
// 将excel表格模板设置全局
Vue.prototype.$FileSaver = FileSaver; 
Vue.prototype.$XLSX = XLSX; 



Vue.use(slideVerify);//验证码
Vue.prototype.axios = axios
Vue.use(ElementUI);
Vue.config.productionTip = false
axios.defaults.baseURL = 'http://localhost:3000'

Vue.filter('shijian', function (input) {
  return shijian(input).format('YYYY-MM-DD')
})



let token = sessionStorage.getItem("token")
if(token){
  axios.defaults.headers.common['Authorization'] = token
}



new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
